<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class AppCourseVideo extends Model
{
    use HasFactory;

    protected function serializeDate(\DateTimeInterface $date)
    {
        return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
    }

    public function video()
    {
        return $this->hasOne('App\Models\AppVideo','id','video_id')->select('id','file_id','duration','size','sort','play_url');
    }

}
